<template>
    <div>
           <van-address-edit
  :area-list="areaList"
  show-postal
  show-delete
  show-search-result
  :search-result="searchResult"
  :area-columns-placeholder="['请选择', '请选择', '请选择']"
  @save="onSave"
  @delete="onDelete"
  @change-detail="onChangeDetail"
  
/>
    </div>
</template>

<script>
import { Toast } from 'vant';
import areaList from "../assets/js/area.js"

    export default {
          data() {
    return {
     areaList,
      searchResult: [],
    //   address:null,
    };
  },
  methods: {
    onSave(data) {
        // this.address=data
     this.$router.push('/enter')
      this.$emit('song', data);
    },
    onDelete() {
      Toast('delete');
    },
    onChangeDetail(val) {
      if (val) {
        this.searchResult = [
          {
            name: '棋杆镇粤嵌科技园888号',
            address: '从化区',
          },
        ];
      } else {
        this.searchResult = [];
      }
    },
  },
    }
</script>

<style lang="scss" scoped>

</style>